export function useRegexp(value: string, type: string): boolean {
  const patterns: Record<string, RegExp> = {
    email: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
    telephone: /^1[3-9]\d{9}$/,
    url: /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,
    password: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/,
    username: /^[a-zA-Z0-9_]{5,16}$/,
  }
  return patterns[type]?.test(value) ?? false
}
